﻿//++
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// Module Name:
//
//  NotificationStatusCondition.cs
//    
// Abstract:
//
//  This class represents the presence status condition for a Notification rule.
//  
//--

using System;
using System.Diagnostics;

namespace Microsoft.EnhancedReminders
{
    /// <summary>
    /// Specifies the presence status condition.
    /// </summary>
    [Serializable()]
    public sealed class NotificationStatusCondition : NotificationCondition
    {
        PresenceStates _presenceFlags = PresenceStates.None;

        /// <summary>
        /// Default constructor
        /// </summary>
        public NotificationStatusCondition()
        {
        }

        /// <summary>
        /// Copy constructor
        /// </summary>
        /// <param name="statusCondition">The status condition to copy.</param>
        public NotificationStatusCondition(NotificationStatusCondition statusCondition)
            : base(statusCondition)
         {
            Debug.Assert(statusCondition != null, "statusCondition");

            _presenceFlags = statusCondition._presenceFlags;
        }

        /// <summary>
        /// Determines if this condition matches the specified data.
        /// </summary>
        /// <param name="notificationData">Data</param>
        /// <returns>
        /// Always return true because the presence status of the recipient is unknown until the point of delivery
        /// for the notification.
        /// </returns>
        public override bool IsSatisfied(INotificationData notificationData)
        {
            Debug.Assert(notificationData != null, "notificationData != null");

            return true;
        }

        /// <summary>
        /// The presence status flags.
        /// </summary>
        public PresenceStates Presence
        {
            get
            {
                return _presenceFlags;
            }
            set
            {
                _presenceFlags = value;
            }
        }
    }
}
